import { createContext } from 'react';

interface Config {
  prefix?: string;
}

const defaultConfig: Config = {
  prefix: '',
};
export const ConfigContext = createContext(defaultConfig);

interface TestSrc {
  testImgs?: string[];
}

const defaultSrc: TestSrc = {
  testImgs: [
    'https://pic2.imgdb.cn/item/64494af00d2dde57777da267.png',
    'https://pic2.imgdb.cn/item/644e14910d2dde5777cb8616.png',
    'https://pic2.imgdb.cn/item/644e14dc0d2dde5777cbc28e.png',
    'https://pic2.imgdb.cn/item/644e14910d2dde5777cb85e2.png',
    'https://pic2.imgdb.cn/item/644e14910d2dde5777cb85cf.png',
    'https://pic2.imgdb.cn/item/644e14910d2dde5777cb85fd.png',
    'https://pic2.imgdb.cn/item/644e14dc0d2dde5777cbc214.png',
    'https://pic2.imgdb.cn/item/644e14dc0d2dde5777cbc26e.png',
    'https://pic2.imgdb.cn/item/644e14dd0d2dde5777cbc2b9.png',
    'https://pic2.imgdb.cn/item/644e15580d2dde5777cc2d2f.png',
  ],
};

export const SrcContext = createContext(defaultSrc);

interface NavItem {
  id: number;
  title: string;
  iconName: string;
  nav: string;
};
const defaultNavs: NavItem[] = [
  {
    id: 0,
    title: '首页',
    iconName: 'home',
    nav: '../home/index'
  },
  {
    id: 1,
    title: '课程',
    iconName: 'app',
    nav: '../course/index'
  },
  {
    id: 2,
    title: '记录',
    iconName: 'history',
    nav: '../history/index'
  }
]
export const NavContext = createContext(defaultNavs);

export enum STATUS { STUDENT, TEACHER, ADMIN, INSTRUCTOR };
export const STATUS_COLOR = ['red', 'orange', 'blue', 'green'];
export const STATUS_NAME = ['学生', '老师', '教务', '辅导员'];
export const STATUS_NAME_EN = ['student', 'teacher', 'admin', 'instructor'];

export interface courseInfo {
  code: string,
  courseName: string,
  endDate: string,
  endTime: string,
  startDate: string,
  startTime: string,
  teacher: string,
  teacherId: string,
  weekday: string,
  _id: string,
  active: boolean,
  students: string[],
  check: {
    date: string,
    students: string[],
    leaveStudents: string[]
  }[],
  method: string,
  verifyCode: string,
  location: any,
  leaveStudents: string[]
}
export interface studentInfo {
  code: string,
  name: string,
  instructor: string
}
